#define  _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int maxArea(vector<int>& height) {
        int left = 0, right = height.size() - 1;
        int storage = 0;
        while (left < right)
        {
            int h = 0;
            int a = right - left;
            if (height[left] > height[right])
            {
                h = height[right--];
            }
            else
            {
                h = height[left++];
            }
            storage = max(a * h, storage);
        }
        return storage;
    }
};